<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>兑奖点盘点报表</title>
<script type="text/javascript" language="javascript" src="../script/common.js"></script>
<script type="text/javascript" language="javascript" src="../script/common_stat.js"></script>

<style>
</style>

<script type="text/javascript" language="javascript">
	var crosstab = new Crosstab();
	
	var dimensions = {"province":"城市","org":{name:"所属机构",option:{"p700":"兑奖点"}},"name":"礼品名称"}
	var measures = {"sum":"入库数量"}
	var defaultHorizon = {"province":true,"org":{"p700":true},"name":true}
	var defaultVertical = {}
	var defaultMeasure = {"sum":true}
	var crossconf = {
		dimensions : dimensions,
		measures : measures,
		defaultMeasure : defaultMeasure,
		defaultVertical : defaultVertical,
		defaultHorizon : defaultHorizon
	}
	var pivot;
	var crosstab1 = new Crosstab();
	
	var dimensions1 = {"province":"城市","org":{name:"所属机构",option:{"p700":"兑奖点"}},"name":"礼品名称"}
	var measures1 = {"sum":"入库数量"}
	var defaultHorizon1 = {"province":true,"org":{"p700":true},"name":true}
	var defaultVertical1 = {}
	var defaultMeasure1 = {"sum":true}
	var crossconf1 = {
		dimensions : dimensions1,
		measures : measures1,
		defaultMeasure : defaultMeasure1,
		defaultVertical : defaultVertical1,
		defaultHorizon : defaultHorizon1
	}
	var pivot1;
		
			function load(){		
			Eui.showNavigation();
			setPages(["queryView","view"]);
			Eui.initBeginDateInput("beginDateTd","起始时间","searchForm","beginDate","endDate","",true);
			Eui.initEndDateInput("endDateTd","结束时间","searchForm","beginDate","endDate","_pastDate",true);
			searchForm.endDate.value = TX.Misc.getDateBefore(1);//默认日期,昨天
			pivot = new Pivot("crosstabview","inventory_info_stat");		
			pivot.initConf(crossconf);
			pivot.setPivotHead('pivotTitle','兑奖点盘点报表-(入库报表)');
			pivot1 = new Pivot("pirotView","inventory_info_outstat");		
			pivot1.initConf(crossconf1);
			pivot1.setPivotHead('pivotTitle','兑奖点盘点报表-(出库报表)');			
			}	
		function doQuery(){
			if(!checkForm("searchForm"))
				return;
		var endDate=searchForm.endDate.value;
		var beginDate=searchForm.beginDate.value;
		pivot.setPivotHead('statTime',Format.today(true));
		pivot.setPivotHead('statClass',"无");
		pivot.setPivotHead('beginTime',beginDate);
		pivot.setPivotHead('endTime',endDate);
		pivot.param = paramFunc();
		pivot.refresh();
		pivot1.setPivotHead('statTime',Format.today(true));
		pivot1.setPivotHead('statClass',"无");
		pivot1.setPivotHead('beginTime',beginDate);
		pivot1.setPivotHead('endTime',endDate);
		pivot1.param = paramFunc();
		pivot1.refresh();	
		switchPage("view");
		}
		function paramFunc(){
		var cOrg = Common.cOrg();
		return Common.getValues(searchForm);
	}
		</script>
</head>
	
	<body onload="load()">
		<div class="nav"><div id="nav">&nbsp;</div></div>
		<div id="getHtmlPrintdiv" style="display:none;"></div>
		<div id="queryView" class="searchForm">
		<div class="formTitle">盘点统计：查询条件</div>
			<form id="searchForm" name="searchForm">
			<input type="hidden" name="orgId"/>
			<input type="hidden" name="orgLevel"/>
			<input type="hidden" name="currentOrg"/>
			<input type="hidden" name="currentOrgLevel"/>	
				<table cellSpacing="0" cellPadding="4" width="100%" border="0">
					<tr>			
						<td id="beginDateTd"></td>
						<td id="endDateTd"></td>
						<td><button onclick="doQuery()">查询报表</button>
						</td>
					</tr>
				</table>
			</form>
		</div>
		<div id="view" style="display:none">
		<div id="crosstabview"></div>
		<div id="pirotView"></div>
		</div>
	</body>
</html>
